<?php
abstract class Controller_Template
{
    protected $selfModel;
    protected static $instance;
    public static $db;

    protected function __construct()
    {
    }

    public static function getInstance()
    {
        $class = get_called_class();
//        echo "<br/>get_called_class(): $class</br>";
//        echo '$class::$instance<br/>';
//        var_dump($class::$instance);
//        echo 'self::$instance<br/>';
//        var_dump(self::$instance);
        if($class::$instance == null || $class != self::$instance)
        {
            $class::$instance = new $class();
        }
        return $class::$instance;
    }
}